All shapefiles were projected into the Texas mapping projection for the purposes of creating maps and calculating the physical properties of the districts’ shape.
Map 1: Reference Map of Commissioners Districts
Map 2: Reference Map of JP & Constable Districts
## GEOPROCESSING OF OTHER SPATIAL FEATURES FOR MAPS
#If you need other spatial features for the maps process/clean in this chunk
schools_prj <- schools %>%
st_transform(st_crs(tx_precincts))
## COMMISH INTERACTIVE MAPPING
commish_pal <- colorFactor(
palette = "Spectral",
domain = cnty_commish_dists_prj$district_type
)
leaflet() %>%
addTiles() %>%
addPolygons(
data = cnty_commish_dists_prj %>% st_transform(prj_webmap),
fillColor = ~commish_pal(district_type),
color = "white",
opacity = 0.5,
fillOpacity = 0.5,
weight = 1) %>%
addLegend(
data = cnty_commish_dists_prj,
pal = commish_pal,
values = ~district_type,
title = "Map 3: County Commissioner Interactive Map"
)
## JP/CONSTABLE INTERACTIVE MAPPING
JP_pal <- colorFactor(
palette = "Accent",
domain = cnty_JP_dists_prj$district_type
)
leaflet() %>%
addTiles() %>%
addPolygons(
data = cnty_JP_dists_prj %>% st_transform(prj_webmap),
fillColor = ~JP_pal(district_type),
color = "white",
opacity = 0.5,
fillOpacity = 0.5,
weight = 1) %>%
addLegend(
data = cnty_JP_dists_prj,
pal = JP_pal,
values = ~district_type,
title = "Map 4: JP/Constable Districts Interactive Map"
)
The area and perimeter of each district was calculated. Then, several compactness measures were computed. For all four measures, a score closer to 1 indicates higher compactness.
Among the county commissioners’ districts, district 1 stands out as the least compact (i.e., most irregular). District 1 scores higher on convexity than all of the other measures, which indicates that the district has a convex shape. However, the elongated maximum width of the district and its area set it apart as particularly irregular.
Similarly, the JP districts tend to be more convex in shape. However, a handful score high on elongation, like JP districts 2, 5, and 8.
##### CALCULATE COMPACTNESS MEASURES
polsby_popper = function(poly1) {
return(drop_units(
4 * pi * st_area(poly1) / st_length(st_boundary(poly1))^2))
}
schwartzberg = function(poly1) {
return(polsby_popper(poly1)^-0.5)
}
inv_schwartzberg = function(poly1) {
return(polsby_popper(poly1)^0.5)
}
area_convex_hull = function(poly1, ch = NULL) {
if (is.null(ch)) {
ch = st_convex_hull(st_geometry(poly1))
}
return(drop_units(st_area(poly1) / st_area(ch)))
}
reock = function(poly1, mbc = NULL) {
if (is.null(mbc)) {
mbc = st_minimum_bounding_circle(st_convex_hull(st_geometry(poly1)))
}
return(drop_units(st_area(poly1) / st_area(mbc)))
}
cnty_districts_land_table <- rbind(cnty_commish_dists_prj, cnty_JP_dists_prj) %>%
mutate(polsby_popper = polsby_popper(geometry),
schwartzberg = schwartzberg(geometry),
inv_schwartzberg = inv_schwartzberg(geometry),
reock = reock(geometry),
area_convex_hull = area_convex_hull(geometry))
knitr::kable(cnty_districts_land_table %>%
st_set_geometry(NULL) %>%
select(-schwartzberg) %>%
rename(`District Type` = "district_type",
Precincts = n_precincts,
`polsby-popper` = "polsby_popper",
`area convex hull` = "area_convex_hull",
`inverse schwartzberg` = "inv_schwartzberg"
), caption = "Table 1: Compactness Scores by District")
| District Type | Precincts | area | perimeter | polsby-popper | inverse schwartzberg | reock | area convex hull |
|---|---|---|---|---|---|---|---|
| CC-01 | 219 | 686835752 [m^2] | 351645.55 [m] | 0.1187862 | 0.3446537 | 0.2618557 | 0.6353092 |
| CC-02 | 167 | 412429004 [m^2] | 183569.10 [m] | 0.4242672 | 0.6513580 | 0.6071442 | 0.9286122 |
| CC-03 | 159 | 548775689 [m^2] | 287734.99 [m] | 0.3608833 | 0.6007356 | 0.4479380 | 0.8566063 |
| CC-04 | 184 | 685991592 [m^2] | 319305.49 [m] | 0.1755394 | 0.4189743 | 0.5030534 | 0.7731104 |
| JP-01 | 104 | 224869063 [m^2] | 139393.51 [m] | 0.3288311 | 0.5734380 | 0.4212736 | 0.8000391 |
| JP-02 | 85 | 179082236 [m^2] | 95551.95 [m] | 0.2573010 | 0.5072485 | 0.3257384 | 0.7368410 |
| JP-03 | 116 | 424499209 [m^2] | 213865.30 [m] | 0.4688542 | 0.6847293 | 0.4940934 | 0.8726436 |
| JP-04 | 69 | 497307299 [m^2] | 186897.24 [m] | 0.5180230 | 0.7197381 | 0.5399593 | 0.8862616 |
| JP-05 | 85 | 101956693 [m^2] | 93082.77 [m] | 0.1845501 | 0.4295929 | 0.3216107 | 0.6279513 |
| JP-06 | 78 | 377705747 [m^2] | 171786.65 [m] | 0.4831084 | 0.6950600 | 0.5184064 | 0.8955504 |
| JP-07 | 107 | 363756270 [m^2] | 177608.86 [m] | 0.4328215 | 0.6578917 | 0.3817434 | 0.8646804 |
| JP-08 | 85 | 164856067 [m^2] | 95705.57 [m] | 0.2565861 | 0.5065433 | 0.3433722 | 0.7580357 |
Table 1, shown below, summarizes the growth in Tarrant County from the last decennial Census in 2010 through 2019. Tarrant has added just over 240,000 people, which is a 13% change from 2010. The citizen-voting age population has grown by just under 25,000 - a 2% growth rate.
## 2010
census2010_table <- readRDS("census2010_table.rds")
## 2019
acs19_full <- readRDS("acs19_full.rds")
## Time Table
knitr::kable(acs19_full %>%
summarize(total_population_2019 = sum(pop, na.rm =T),
cvap_2019 = sum(CVAP, na.rm =T)) %>%
pivot_longer(ends_with("_2019"),
names_to = "variable",
values_to = "Total, 2019") %>%
mutate(variable = str_remove(variable, "_2019"),
variable = str_replace_all(variable, "_", " ")) %>%
left_join(census2010_table, by = c("variable")) %>%
relocate(variable, `Total, 2010`, `Total, 2019`) %>%
mutate(`Total Change` = `Total, 2019` - `Total, 2010`,
`% Change` = `Total Change` / `Total, 2010`,
`% Change` = percent(`% Change`,
accuracy = 0.01,
scale = 100,
label = "%"),
`Total Change` = format(`Total Change`, big.mark = ","),
`Total, 2010` = format(`Total, 2010`, big.mark = ","),
`Total, 2019` = format(`Total, 2019`, big.mark = ",")),
caption = "Table 2: Tarrant County Population 2010 & 2019")
| variable | Total, 2010 | Total, 2019 | Total Change | % Change |
|---|---|---|---|---|
| total population | 1,809,034 | 2,049,770 | 240,736 | 13.31% |
| cvap | 1,301,973 | 1,326,447 | 24,474 | 1.88% |
## CVAP 2019 Summary
CVAP19_summary <- acs19_full %>%
select(c(3:19)) %>%
select(c(-6:-7, -9:-12)) %>%
summarise_if(is.numeric, sum, na.rm = T) %>%
relocate(`High school graduate (includes equivalency)`,
.after = `No high school diploma`) %>%
pivot_longer(cols = c(1:11),
names_to = "Group",
values_to = "Total") %>%
mutate(`% of CVAP` = percent(Total / first(Total),
accuracy = 0.01,
scale = 100,
label = "%" ),
Total = format(Total, big.mark = ","))
knitr::kable(CVAP19_summary,
caption = "Table 2.1: Summary of Citizen Voting-Age Demographics")
| Group | Total | % of CVAP |
|---|---|---|
| CVAP | 1,326,447 | 100.00% |
| 18 to 29 years | 305,006 | 22.99% |
| 30 to 44 years | 356,637 | 26.89% |
| 45 to 64 years | 449,268 | 33.87% |
| 65 years and over | 215,536 | 16.25% |
| Income in the past 12 months below poverty level | 116,083 | 8.75% |
| Income in the past 12 months at or above the poverty level | 1,190,962 | 89.79% |
| No high school diploma | 127,341 | 9.60% |
| High school graduate (includes equivalency) | 335,023 | 25.26% |
| Some college or Associates | 449,649 | 33.90% |
| Bachelor’s or Graduate degree | 414,434 | 31.24% |
## Race 2019 Summary
Race19_summary <- acs19_full %>%
select(c(2, 20:27)) %>%
rename(`Total population` = "pop") %>%
summarise_if(is.numeric, sum, na.rm = T) %>%
pivot_longer(cols = c(1:9),
names_to = "Group",
values_to = "Total") %>%
mutate(`% of Population` = percent(Total / first(Total),
accuracy = 0.01,
scale = 100,
label = "%" ),
Total = format(Total, big.mark = ","),
Group = str_replace(Group, "_", " "))
knitr::kable(Race19_summary,
caption = "Table 2.3: Summary of Racial Demographics in Tarrant County")
| Group | Total | % of Population |
|---|---|---|
| Total population | 2,049,770 | 100.00% |
| White, Not Latinx | 957,676 | 46.72% |
| Black, Not Latinx | 330,853 | 16.14% |
| Two or More, Not Latinx | 1,330 | 0.06% |
| Other, Not Latinx | 4,441 | 0.22% |
| NHPI, Not Latinx | 3,802 | 0.19% |
| Asian, Not Latinx | 110,144 | 5.37% |
| American Indian, Not Latinx | 6,154 | 0.30% |
| Any race, Latinx | 590,485 | 28.81% |
## Household 2019 Summary
HH19_summary <- acs19_full %>%
select(c(28:45)) %>%
relocate(limited_english, .after = Households) %>%
rename(`Limited English Proficiency` = "limited_english") %>%
summarise_if(is.numeric, sum, na.rm = T) %>%
pivot_longer(cols = c(1:18),
names_to = "Group",
values_to = "Total") %>%
mutate(`% of Population` = percent(Total / first(Total),
accuracy = 0.01,
scale = 100,
label = "%" ),
Total = format(Total, big.mark = ","),
Group = str_replace(Group, "_", " "))
knitr::kable(HH19_summary,
caption = "Table 2.4: Summary of Household Demographics in Tarrant County")
| Group | Total | % of Population |
|---|---|---|
| Households | 708,252 | 100.00% |
| Limited English Proficiency | 44,711 | 6.31% |
| Less than $10,000 | 32,868 | 4.64% |
| $10,000 to $14,999 | 23,111 | 3.26% |
| $15,000 to $19,999 | 24,250 | 3.42% |
| $20,000 to $24,999 | 26,811 | 3.79% |
| $25,000 to $29,999 | 29,477 | 4.16% |
| $30,000 to $34,999 | 32,679 | 4.61% |
| $35,000 to $39,999 | 31,016 | 4.38% |
| $40,000 to $44,999 | 29,985 | 4.23% |
| $45,000 to $49,999 | 25,389 | 3.58% |
| $50,000 to $59,999 | 57,163 | 8.07% |
| $60,000 to $74,999 | 73,924 | 10.44% |
| $75,000 to $99,999 | 96,569 | 13.63% |
| $100,000 to $124,999 | 68,829 | 9.72% |
| $125,000 to $149,999 | 47,431 | 6.70% |
| $150,000 to $199,999 | 52,068 | 7.35% |
| $200,000 or more | 56,682 | 8.00% |
#### GEOPROCESSING OF BLOCK GROUPS
cnty_bgs_prj <- county_bgs %>%
dplyr::select(GEOID) %>%
st_transform(st_crs(cnty_commish_dists_prj)) %>%
mutate(bg_area = st_area(.)) %>%
left_join(acs19_full, by = c("GEOID" = "cbg")) %>%
dplyr::select(-GEOID)
#### APPORTION DEMOGRAPHIC POPULATIONS TO DISTRICTS
cnty_commish_apportion <- st_interpolate_aw(cnty_bgs_prj,
cnty_commish_dists_prj,
extensive = T)
cnty_JP_apportion <- st_interpolate_aw(cnty_bgs_prj,
cnty_JP_dists_prj,
extensive = T)
Table 2.5: County Commissioner’s CVAP Apportionment
# CVAP apportionment - CC
cnty_commish_apportion_cvap <- cnty_commish_apportion %>%
dplyr::select(Group.1, pop:X65.years.and.over,
High.school.graduate..includes.equivalency.,
Income.in.the.past.12.months.below.poverty.level:Bachelor.s.or.Graduate.degree) %>%
relocate(No.high.school.diploma, .after = X65.years.and.over) %>%
relocate(Some.college.or.Associates, .after = High.school.graduate..includes.equivalency.) %>%
relocate(Bachelor.s.or.Graduate.degree, .after=Some.college.or.Associates) %>%
rename(District = "Group.1",
total_population = "pop") %>%
st_set_geometry(NULL) %>%
pivot_longer(cols = c(2:13),
names_to = "Group",
values_to = "estimated_count") %>%
mutate(Group = str_remove(Group, "X"),
Group = str_replace_all(Group, "/.", " "),
District = paste0("CC-0", District)) %>%
pivot_wider(id_cols = District,
names_from = "Group",
values_from = "estimated_count") %>%
mutate_each(funs(prettyNum(., big.mark=",")))
rmarkdown::paged_table(cnty_commish_apportion_cvap)
Table 2.6: Apportionment of Race by Commissioner’s District
# race apportionment - CC
cnty_commish_apportion_race <- cnty_commish_apportion %>%
dplyr::select(Group.1, pop, White..Not_Latinx:Any.race..Latinx) %>%
rename(District = "Group.1",
total_population = "pop") %>%
st_set_geometry(NULL) %>%
pivot_longer(cols = c(total_population:Any.race..Latinx),
names_to = "Group",
values_to = "estimated_count") %>%
mutate(Group = str_remove(Group, "X"),
Group = str_replace_all(Group, "/.", " "),
District = paste0("CC-0", District)) %>%
pivot_wider(id_cols = District,
names_from = "Group",
values_from = "estimated_count") %>%
mutate_each(funs(prettyNum(., big.mark=",")))
rmarkdown::paged_table(cnty_commish_apportion_race,list(rows.print = 4))
Table 2.7: JP/Constable CVAP Apportionment
# CVAP apportionment - JP
cnty_JP_apportion_cvap <- cnty_JP_apportion %>%
dplyr::select(Group.1, pop:X65.years.and.over,
High.school.graduate..includes.equivalency.,
Income.in.the.past.12.months.below.poverty.level:Bachelor.s.or.Graduate.degree) %>%
relocate(No.high.school.diploma, .after = X65.years.and.over) %>%
relocate(Some.college.or.Associates, .after = High.school.graduate..includes.equivalency.) %>%
relocate(Bachelor.s.or.Graduate.degree, .after=Some.college.or.Associates) %>%
rename(District = "Group.1",
total_population = "pop") %>%
st_set_geometry(NULL) %>%
pivot_longer(cols = c(2:13),
names_to = "Group",
values_to = "estimated_count") %>%
mutate(Group = str_remove(Group, "X"),
Group = str_replace_all(Group, "/.", " "),
District = paste0("JP-0", District)) %>%
pivot_wider(id_cols = District,
names_from = "Group",
values_from = "estimated_count") %>%
mutate_each(funs(prettyNum(., big.mark=",")))
rmarkdown::paged_table(cnty_JP_apportion_cvap, list(rows.print = 8))
Table 2.8: Apportionment of Race by JP/Constable District
# race apportionment - JP
cnty_JP_apportion_race <- cnty_JP_apportion %>%
dplyr::select(Group.1, pop, White..Not_Latinx:Any.race..Latinx) %>%
rename(District = "Group.1",
total_population = "pop") %>%
st_set_geometry(NULL) %>%
pivot_longer(cols = c(total_population:Any.race..Latinx),
names_to = "Group",
values_to = "estimated_count") %>%
mutate(Group = str_remove(Group, "X"),
Group = str_replace_all(Group, "/.", " "),
District = paste0("JP-0", District)) %>%
pivot_wider(id_cols = District,
names_from = "Group",
values_from = "estimated_count") %>%
mutate_each(funs(prettyNum(., big.mark=",")))
rmarkdown::paged_table(cnty_JP_apportion_race, list(rows.print = 8, cols.print = 9))
Election Results 2020
Only two county commissioners seats were up for election in 2020 - seats 1 and 3. The outcomes of the elections are summarized below in Table 2. The Democratic candidate running for seat 1, Roy Brooks, won his seat with 60% of the vote. The race for seat 3 was not a victory for Democrats. Democratic candidate Kathy Braatz took approximately 36% of the votes in district 3. There is not a substantial difference between the mean and median vote share at the precinct level. Thus, there is not strong evidence of variation between precincts in voting patterns in either of these districts.
## COUNTY COMMISSIONER'S RESULTS
commish_2020_summary <- commish_2020_all %>%
mutate(vote_share_d_prec = (dem_votes/total_votes) * 100) %>%
group_by(district) %>%
summarize("Precincts" = n(),
`D Votes` = sum(dem_votes, na.rm =T),
`R Votes` = sum(repub_votes, na.rm = T),
`D Vote Share` = percent(`D Votes`/(`D Votes`+ `R Votes`),
accuracy = 0.01,
scale = 100,
label = "%"),
`Mean D Vote Share` = round(mean(vote_share_d_prec, na.rm = T), digits=2),
`Median D Vote Share` = round(median(vote_share_d_prec, na.rm = T), digits=2),
`Vote Skew` = round(`Mean D Vote Share`-`Median D Vote Share`, digits=2),
`D Votes` = format(`D Votes`, big.mark = ","),
`R Votes` = format(`R Votes`, big.mark = ",")
)
knitr::kable(commish_2020_summary,
caption = "Table 2: Summary of 2020 County Commissioners Election Results")
| district | Precincts | D Votes | R Votes | D Vote Share | Mean D Vote Share | Median D Vote Share | Vote Skew |
|---|---|---|---|---|---|---|---|
| Commissioner 01 | 218 | 105,482 | 69,223 | 60.38% | 63.28 | 65.22 | -1.94 |
| Commissioner 03 | 159 | 87,694 | 156,123 | 35.97% | 34.87 | 35.04 | -0.17 |
## CONSTABLE'S RESULTS
constable_2020_summary <- constable_2020_all %>%
mutate(vote_share_d_prec = (dem_votes/total_votes) * 100) %>%
group_by(district) %>%
summarize("Precincts" = n(),
`D Votes` = sum(dem_votes, na.rm =T),
`R Votes` = sum(repub_votes, na.rm = T),
`D Vote Share` = percent(`D Votes`/(`D Votes`+ `R Votes`),
accuracy = 0.01,
scale = 100,
label = "%"),
`Mean D Vote Share` = round(mean(vote_share_d_prec, na.rm = T), digits=2),
`Median D Vote Share` = round(median(vote_share_d_prec, na.rm = T), digits=2),
`Vote Skew` = round(`Mean D Vote Share`-`Median D Vote Share`, digits=2),
`D Votes` = format(`D Votes`, big.mark = ","),
`R Votes` = format(`R Votes`, big.mark = ",")
)
knitr::kable(constable_2020_summary,
caption = "Table 2: Summary of 2020 Constables Election Results")
| district | Precincts | D Votes | R Votes | D Vote Share | Mean D Vote Share | Median D Vote Share | Vote Skew |
|---|---|---|---|---|---|---|---|
| Constable 01 | 103 | 46,362 | 60,341 | 43.45% | 45.86 | 42.37 | 3.49 |
| Constable 02 | 85 | 36,060 | 34,652 | 51.00% | 53.51 | 54.62 | -1.11 |
| Constable 03 | 116 | 0 | 142,646 | 0.00% | NaN | NA | NaN |
| Constable 04 | 69 | 0 | 73,928 | 0.00% | NaN | NA | NaN |
| Constable 05 | 85 | 29,040 | 0 | 100.00% | 100.00 | 100.00 | 0.00 |
| Constable 06 | 78 | 50,185 | 54,743 | 47.83% | 46.81 | 45.90 | 0.91 |
| Constable 07 | 107 | 77,728 | 68,218 | 53.26% | 54.62 | 59.00 | -4.38 |
| Constable 08 | 86 | 41,259 | 0 | 100.00% | 100.00 | 100.00 | 0.00 |
Partisanship Summary
Commissioner’s district 1 has the most democratic voters and district 3 has the fewest. These data help make sense of the results from the 2020 election. What’s noteworthy is that district 3 has a noticeably higher number of high propensity voters than low propensity compared to other districts.
The number of registered voters for district 3 is noticeably higher than the other districts. This district may be an appropriate one to shift boundaries to distribute some more voters, particularly high-propensity voters to district 1 or 2.
## PARTSIANSHIP SUMMARY BY COMMISSIONERS
partisanship_commish_summary <- partisanship %>%
right_join(tx_precincts, by = c("dnc_precinct_id" = "dnc_id")) %>%
right_join(county_precincts, by = c("PREC" = "Pct_Char")) %>%
group_by(Commish) %>%
summarize(`Registered Voters` = format(sum(total_reg_voters, na.rm = T), big.mark=","),
`Democratic Voters` = format(sum(highd, lowd, na.rm = T), big.mark = ","),
`High Propensity Dems` = format(sum(highd, na.rm = T), big.mark = ","),
`Low Propensity Dems` = format(sum(lowd, na.rm = T), big.mark = ","),
Precincts = n()
) %>%
rename(`County Commissioner` = "Commish")
knitr::kable(partisanship_commish_summary,
caption = "Table 3: Summary of Partisanship by County Commissioners District")
| County Commissioner | Registered Voters | Democratic Voters | High Propensity Dems | Low Propensity Dems | Precincts |
|---|---|---|---|---|---|
| 01 | 352,578 | 151,140 | 68,467 | 82,673 | 394 |
| 02 | 373,360 | 135,768 | 67,101 | 68,667 | 245 |
| 03 | 413,142 | 82,903 | 52,589 | 30,314 | 220 |
| 04 | 342,664 | 89,473 | 44,239 | 45,234 | 344 |
There is a lot variation in the number of registered voters between the 8 JP/constable’s districts. At the low end, district 5 has approximately 80,000 registered voters, and at the upper-end district 3 has approximately 316,000 voters. The JP districts with the most democratic voters are districts: 7, 8, and 3, in descending order. Districts 7 and 3 have the highest number of high propensity democratic voters.
## PARTSIANSHIP SUMMARY BY JP
partisanship_JP_summary <- partisanship %>%
right_join(tx_precincts, by = c("dnc_precinct_id" = "dnc_id")) %>%
right_join(county_precincts, by = c("PREC" = "Pct_Char")) %>%
group_by(JP) %>%
summarize(`Registered Voters` = format(sum(total_reg_voters, na.rm = T), big.mark=","),
`Democratic Voters` = format(sum(highd, lowd, na.rm = T), big.mark = ","),
`High Propensity Dems` = format(sum(highd, na.rm = T), big.mark = ","),
`Low Propensity Dems` = format(sum(lowd, na.rm = T), big.mark = ","),
Precincts = n()
)
knitr::kable(partisanship_JP_summary,
caption = "Table 4: Summary of Partisanship by JP/Constables District")
| JP | Registered Voters | Democratic Voters | High Propensity Dems | Low Propensity Dems | Precincts |
|---|---|---|---|---|---|
| 01 | 202,187 | 50,340 | 25,847 | 24,493 | 168 |
| 02 | 146,535 | 49,816 | 22,494 | 27,322 | 119 |
| 03 | 316,012 | 66,147 | 42,445 | 23,702 | 155 |
| 04 | 170,687 | 31,945 | 17,731 | 14,214 | 132 |
| 05 | 80,094 | 37,460 | 15,257 | 22,203 | 168 |
| 06 | 184,013 | 58,923 | 32,351 | 26,572 | 141 |
| 07 | 263,476 | 98,645 | 49,998 | 48,647 | 156 |
| 08 | 118,740 | 66,008 | 26,273 | 39,735 | 164 |
# Create rook neighbors - ID adjacency
precinct_adjacency <- county_precincts_prj %>%
rownames_to_column(., var = "id") %>%
poly2nb(., row.names = "id", queen = F)
for(i in 1:729){
precinct_adjacency[[i]] <- precinct_adjacency[[i]]-1
}
# Apportion block groups to precincts
precincts_demography <- cnty_bgs_prj %>%
select(pop, CVAP, `White, Not_Latinx`:`Any race, Latinx`) %>%
st_interpolate_aw(.,
county_precincts_prj,
extensive = T) %>%
st_set_geometry(NULL)
# DATA FRAME FOR REDISTRICTING JP/CONSTABLE
precincts_JPConst_data <- county_precincts_prj %>%
select(-CNTY, -Commish, -JP) %>%
st_set_geometry(NULL) %>%
merge(., precincts_demography) %>%
mutate(PREC = as.numeric(PREC)) %>%
left_join(constable_2020_all, by = c("PREC" = "precinct")) %>%
left_join(partisanship, by = c("dnc_id" = "dnc_precinct_id")) %>%
select(-PREC, -Group.1, -democrat:-republican) %>%
mutate(dems = highd + lowd,
repubs = total_reg_voters - dems)
precincts_JPConst_lst <- list(precincts_JPConst_data)
precincts_JP_Const_all <- list(precinct_adjacency, precincts_JPConst_data)
names(precincts_JP_Const_all) <- c("precinct_adjacency", "precinct_demogs")
# alg_mcmc_JPConst <- redist.mcmc(adjobj = precincts_JP_Const_all$precinct_adjacency,
# popvec = precincts_JP_Const_all$precinct_demogs$pop,
# initcds = ,
# ndists = 4,
# nsims = 10000,
# savename = "alg_mcmc_JPConst_redist")